package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 水质评估记录表
 * @TableName water_quality_assessment
 */
@TableName(value ="water_quality_assessment")
@Data
public class WaterQualityAssessment implements Serializable {
    /**
     * 评估ID
     */
    @TableId(type = IdType.AUTO)
    private Long assessmentId;

    /**
     * 设备ID
     */
    private Long deviceId;

    /**
     * 评估日期
     */
    private Date assessmentDate;

    /**
     * 总体等级：1-I类，2-II类，3-III类，4-IV类，5-V类
     */
    private Integer overallGrade;

    /**
     * 评估结果
     */
    private String assessmentResult;

    /**
     * 改善建议
     */
    private String suggestions;

    /**
     * 创建时间
     */
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        WaterQualityAssessment other = (WaterQualityAssessment) that;
        return (this.getAssessmentId() == null ? other.getAssessmentId() == null : this.getAssessmentId().equals(other.getAssessmentId()))
            && (this.getDeviceId() == null ? other.getDeviceId() == null : this.getDeviceId().equals(other.getDeviceId()))
            && (this.getAssessmentDate() == null ? other.getAssessmentDate() == null : this.getAssessmentDate().equals(other.getAssessmentDate()))
            && (this.getOverallGrade() == null ? other.getOverallGrade() == null : this.getOverallGrade().equals(other.getOverallGrade()))
            && (this.getAssessmentResult() == null ? other.getAssessmentResult() == null : this.getAssessmentResult().equals(other.getAssessmentResult()))
            && (this.getSuggestions() == null ? other.getSuggestions() == null : this.getSuggestions().equals(other.getSuggestions()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getAssessmentId() == null) ? 0 : getAssessmentId().hashCode());
        result = prime * result + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode());
        result = prime * result + ((getAssessmentDate() == null) ? 0 : getAssessmentDate().hashCode());
        result = prime * result + ((getOverallGrade() == null) ? 0 : getOverallGrade().hashCode());
        result = prime * result + ((getAssessmentResult() == null) ? 0 : getAssessmentResult().hashCode());
        result = prime * result + ((getSuggestions() == null) ? 0 : getSuggestions().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", assessmentId=").append(assessmentId);
        sb.append(", deviceId=").append(deviceId);
        sb.append(", assessmentDate=").append(assessmentDate);
        sb.append(", overallGrade=").append(overallGrade);
        sb.append(", assessmentResult=").append(assessmentResult);
        sb.append(", suggestions=").append(suggestions);
        sb.append(", createTime=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}